const BASE_RUL = "https://wx.yixueks.com/medicalApp/";



export const requestApi = (options) => {
	
	return new Promise((resolve,reject)=>{
		uni.request({
			url: BASE_RUL+options.url,
			method: options.method || 'GET',
			data: options.data || {},
			success: res => {
				if(Number(res.data.code)==0){
					resolve(res.data.result);
				}else{
					uni.showToast({
						icon:"error",
						mask:true,
						duration:2000,
						title:'${res.data.msg}'
					});
					reject(res.data.msg);
				};
			},
			fail: (err) => {
				reject(err);
			}
		});
	});
}


